$(function(){
    fetch(`http://chst.vip:1234/api/getcoupon`)
    .then(body=>body.json())
    .then(res=>{
        let txt = ''
        res.result.forEach(item => {
            txt += `<li couponId='${item.couponId}'>${item.couponTitle}</li>`
        })
        $('.list ul').html(txt)
        $('.list ul li').click(function(){
            let couponId = $(this).attr('couponId')
            location.href = `./youhuiquan_xq.html?couponId=${couponId}`
        })
    })
    $('.header_logo').click(function(){
        location.href = '../index.html'
    })
})